<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /fasttmp/mkdist-qt-4.3.5-1211793125/qtopia-core-opensource-src-4.3.5/src/xml/qdom.cpp -->
<head>
  <title>Qt 4.3: QDomNamedNodeMap Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">QDomNamedNodeMap Class Reference<br /><sup><sup>[<a href="qtxml.html">QtXml</a> module]</sup></sup></h1>
<p>The QDomNamedNodeMap class contains a collection of nodes that can be accessed by name. <a href="#details">More...</a></p>
<pre> #include &lt;QDomNamedNodeMap&gt;</pre><p><b>Note:</b> All the functions in this class are <a href="threads.html#reentrant">reentrant</a>.</p>
<ul>
<li><a href="qdomnamednodemap-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"/><b><a href="qdomnamednodemap.html#QDomNamedNodeMap">QDomNamedNodeMap</a></b> ()</li>
<li><div class="fn"/><b><a href="qdomnamednodemap.html#QDomNamedNodeMap-2">QDomNamedNodeMap</a></b> ( const QDomNamedNodeMap &amp; <i>n</i> )</li>
<li><div class="fn"/><b><a href="qdomnamednodemap.html#dtor.QDomNamedNodeMap">~QDomNamedNodeMap</a></b> ()</li>
<li><div class="fn"/>bool <b><a href="qdomnamednodemap.html#contains">contains</a></b> ( const QString &amp; <i>name</i> ) const</li>
<li><div class="fn"/>int <b><a href="qdomnamednodemap.html#count">count</a></b> () const</li>
<li><div class="fn"/>bool <b><a href="qdomnamednodemap.html#isEmpty">isEmpty</a></b> () const</li>
<li><div class="fn"/>QDomNode <b><a href="qdomnamednodemap.html#item">item</a></b> ( int <i>index</i> ) const</li>
<li><div class="fn"/>uint <b><a href="qdomnamednodemap.html#length">length</a></b> () const</li>
<li><div class="fn"/>QDomNode <b><a href="qdomnamednodemap.html#namedItem">namedItem</a></b> ( const QString &amp; <i>name</i> ) const</li>
<li><div class="fn"/>QDomNode <b><a href="qdomnamednodemap.html#namedItemNS">namedItemNS</a></b> ( const QString &amp; <i>nsURI</i>, const QString &amp; <i>localName</i> ) const</li>
<li><div class="fn"/>QDomNode <b><a href="qdomnamednodemap.html#removeNamedItem">removeNamedItem</a></b> ( const QString &amp; <i>name</i> )</li>
<li><div class="fn"/>QDomNode <b><a href="qdomnamednodemap.html#removeNamedItemNS">removeNamedItemNS</a></b> ( const QString &amp; <i>nsURI</i>, const QString &amp; <i>localName</i> )</li>
<li><div class="fn"/>QDomNode <b><a href="qdomnamednodemap.html#setNamedItem">setNamedItem</a></b> ( const QDomNode &amp; <i>newNode</i> )</li>
<li><div class="fn"/>QDomNode <b><a href="qdomnamednodemap.html#setNamedItemNS">setNamedItemNS</a></b> ( const QDomNode &amp; <i>newNode</i> )</li>
<li><div class="fn"/>int <b><a href="qdomnamednodemap.html#size">size</a></b> () const</li>
<li><div class="fn"/>bool <b><a href="qdomnamednodemap.html#operator-not-eq">operator!=</a></b> ( const QDomNamedNodeMap &amp; <i>n</i> ) const</li>
<li><div class="fn"/>QDomNamedNodeMap &amp; <b><a href="qdomnamednodemap.html#operator-eq">operator=</a></b> ( const QDomNamedNodeMap &amp; <i>n</i> )</li>
<li><div class="fn"/>bool <b><a href="qdomnamednodemap.html#operator-eq-eq">operator==</a></b> ( const QDomNamedNodeMap &amp; <i>n</i> ) const</li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QDomNamedNodeMap class contains a collection of nodes that can be accessed by name.</p>
<p>Note that QDomNamedNodeMap does not inherit from <a href="qdomnodelist.html">QDomNodeList</a>. QDomNamedNodeMaps do not provide any specific node ordering. Although nodes in a QDomNamedNodeMap may be accessed by an ordinal index, this is simply to allow a convenient enumeration of the contents of a QDomNamedNodeMap, and does not imply that the DOM specifies an ordering of the nodes.</p>
<p>The QDomNamedNodeMap is used in three places:</p>
<ol type="1">
<li><a href="qdomdocumenttype.html#entities">QDomDocumentType::entities</a>() returns a map of all entities described in the DTD.</li>
<li><a href="qdomdocumenttype.html#notations">QDomDocumentType::notations</a>() returns a map of all notations described in the DTD.</li>
<li><a href="qdomnode.html#attributes">QDomNode::attributes</a>() returns a map of all attributes of an element.</li>
</ol>
<p>Items in the map are identified by the name which QDomNode::name() returns. Nodes are retrieved using <a href="qdomnamednodemap.html#namedItem">namedItem</a>(), <a href="qdomnamednodemap.html#namedItemNS">namedItemNS</a>() or <a href="qdomnamednodemap.html#item">item</a>(). New nodes are inserted with <a href="qdomnamednodemap.html#setNamedItem">setNamedItem</a>() or <a href="qdomnamednodemap.html#setNamedItemNS">setNamedItemNS</a>() and removed with <a href="qdomnamednodemap.html#removeNamedItem">removeNamedItem</a>() or <a href="qdomnamednodemap.html#removeNamedItemNS">removeNamedItemNS</a>(). Use <a href="qdomnamednodemap.html#contains">contains</a>() to see if an item with the given name is in the named node map. The number of items is returned by <a href="qdomnamednodemap.html#length">length</a>().</p>
<p>Terminology: in this class we use &quot;item&quot; and &quot;node&quot; interchangeably.</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QDomNamedNodeMap"></a>QDomNamedNodeMap::QDomNamedNodeMap ()</h3>
<p>Constructs an empty named node map.</p>
<h3 class="fn"><a name="QDomNamedNodeMap-2"></a>QDomNamedNodeMap::QDomNamedNodeMap ( const QDomNamedNodeMap &amp; <i>n</i> )</h3>
<p>Constructs a copy of <i>n</i>.</p>
<h3 class="fn"><a name="dtor.QDomNamedNodeMap"></a>QDomNamedNodeMap::~QDomNamedNodeMap ()</h3>
<p>Destroys the object and frees its resources.</p>
<h3 class="fn"><a name="contains"></a>bool QDomNamedNodeMap::contains ( const <a href="qstring.html">QString</a> &amp; <i>name</i> ) const</h3>
<p>Returns true if the map contains a node called <i>name</i>; otherwise returns false.</p>
<p><b>Note:</b> This function does not take the presence of namespaces into account. Use <a href="qdomnamednodemap.html#namedItemNS">namedItemNS</a>() to test whether the map contains a node with a specific namespace URI and name.</p>
<h3 class="fn"><a name="count"></a>int QDomNamedNodeMap::count () const</h3>
<p>This function is provided for Qt API consistency. It is equivalent to <a href="qdomnamednodemap.html#length">length</a>().</p>
<h3 class="fn"><a name="isEmpty"></a>bool QDomNamedNodeMap::isEmpty () const</h3>
<p>Returns true if the map is empty; otherwise returns false. This function is provided for Qt API consistency.</p>
<h3 class="fn"><a name="item"></a><a href="qdomnode.html">QDomNode</a> QDomNamedNodeMap::item ( int <i>index</i> ) const</h3>
<p>Retrieves the node at position <i>index</i>.</p>
<p>This can be used to iterate over the map. Note that the nodes in the map are ordered arbitrarily.</p>
<p>See also <a href="qdomnamednodemap.html#length">length</a>().</p>
<h3 class="fn"><a name="length"></a><a href="qtglobal.html#uint-typedef">uint</a> QDomNamedNodeMap::length () const</h3>
<p>Returns the number of nodes in the map.</p>
<p>See also <a href="qdomnamednodemap.html#item">item</a>().</p>
<h3 class="fn"><a name="namedItem"></a><a href="qdomnode.html">QDomNode</a> QDomNamedNodeMap::namedItem ( const <a href="qstring.html">QString</a> &amp; <i>name</i> ) const</h3>
<p>Returns the node called <i>name</i>.</p>
<p>If the named node map does not contain such a node, a <a href="qdomnode.html#isNull">null node</a> is returned. A node's name is the name returned by <a href="qdomnode.html#nodeName">QDomNode::nodeName</a>().</p>
<p>See also <a href="qdomnamednodemap.html#setNamedItem">setNamedItem</a>() and <a href="qdomnamednodemap.html#namedItemNS">namedItemNS</a>().</p>
<h3 class="fn"><a name="namedItemNS"></a><a href="qdomnode.html">QDomNode</a> QDomNamedNodeMap::namedItemNS ( const <a href="qstring.html">QString</a> &amp; <i>nsURI</i>, const <a href="qstring.html">QString</a> &amp; <i>localName</i> ) const</h3>
<p>Returns the node associated with the local name <i>localName</i> and the namespace URI <i>nsURI</i>.</p>
<p>If the map does not contain such a node, a <a href="qdomnode.html#isNull">null node</a> is returned.</p>
<p>See also <a href="qdomnamednodemap.html#setNamedItemNS">setNamedItemNS</a>() and <a href="qdomnamednodemap.html#namedItem">namedItem</a>().</p>
<h3 class="fn"><a name="removeNamedItem"></a><a href="qdomnode.html">QDomNode</a> QDomNamedNodeMap::removeNamedItem ( const <a href="qstring.html">QString</a> &amp; <i>name</i> )</h3>
<p>Removes the node called <i>name</i> from the map.</p>
<p>The function returns the removed node or a <a href="qdomnode.html#isNull">null node</a> if the map did not contain a node called <i>name</i>.</p>
<p>See also <a href="qdomnamednodemap.html#setNamedItem">setNamedItem</a>(), <a href="qdomnamednodemap.html#namedItem">namedItem</a>(), and <a href="qdomnamednodemap.html#removeNamedItemNS">removeNamedItemNS</a>().</p>
<h3 class="fn"><a name="removeNamedItemNS"></a><a href="qdomnode.html">QDomNode</a> QDomNamedNodeMap::removeNamedItemNS ( const <a href="qstring.html">QString</a> &amp; <i>nsURI</i>, const <a href="qstring.html">QString</a> &amp; <i>localName</i> )</h3>
<p>Removes the node with the local name <i>localName</i> and the namespace URI <i>nsURI</i> from the map.</p>
<p>The function returns the removed node or a <a href="qdomnode.html#isNull">null node</a> if the map did not contain a node with the local name <i>localName</i> and the namespace URI <i>nsURI</i>.</p>
<p>See also <a href="qdomnamednodemap.html#setNamedItemNS">setNamedItemNS</a>(), <a href="qdomnamednodemap.html#namedItemNS">namedItemNS</a>(), and <a href="qdomnamednodemap.html#removeNamedItem">removeNamedItem</a>().</p>
<h3 class="fn"><a name="setNamedItem"></a><a href="qdomnode.html">QDomNode</a> QDomNamedNodeMap::setNamedItem ( const <a href="qdomnode.html">QDomNode</a> &amp; <i>newNode</i> )</h3>
<p>Inserts the node <i>newNode</i> into the named node map. The name used by the map is the node name of <i>newNode</i> as returned by <a href="qdomnode.html#nodeName">QDomNode::nodeName</a>().</p>
<p>If the new node replaces an existing node, i.e&#x2e; the map contains a node with the same name, the replaced node is returned.</p>
<p>See also <a href="qdomnamednodemap.html#namedItem">namedItem</a>(), <a href="qdomnamednodemap.html#removeNamedItem">removeNamedItem</a>(), and <a href="qdomnamednodemap.html#setNamedItemNS">setNamedItemNS</a>().</p>
<h3 class="fn"><a name="setNamedItemNS"></a><a href="qdomnode.html">QDomNode</a> QDomNamedNodeMap::setNamedItemNS ( const <a href="qdomnode.html">QDomNode</a> &amp; <i>newNode</i> )</h3>
<p>Inserts the node <i>newNode</i> in the map. If a node with the same namespace URI and the same local name already exists in the map, it is replaced by <i>newNode</i>. If the new node replaces an existing node, the replaced node is returned.</p>
<p>See also <a href="qdomnamednodemap.html#namedItemNS">namedItemNS</a>(), <a href="qdomnamednodemap.html#removeNamedItemNS">removeNamedItemNS</a>(), and <a href="qdomnamednodemap.html#setNamedItem">setNamedItem</a>().</p>
<h3 class="fn"><a name="size"></a>int QDomNamedNodeMap::size () const</h3>
<p>This function is provided for Qt API consistency. It is equivalent to <a href="qdomnamednodemap.html#length">length</a>().</p>
<h3 class="fn"><a name="operator-not-eq"></a>bool QDomNamedNodeMap::operator!= ( const QDomNamedNodeMap &amp; <i>n</i> ) const</h3>
<p>Returns true if <i>n</i> and this named node map are not equal; otherwise returns false.</p>
<h3 class="fn"><a name="operator-eq"></a>QDomNamedNodeMap &amp; QDomNamedNodeMap::operator= ( const QDomNamedNodeMap &amp; <i>n</i> )</h3>
<p>Assigns <i>n</i> to this named node map.</p>
<h3 class="fn"><a name="operator-eq-eq"></a>bool QDomNamedNodeMap::operator== ( const QDomNamedNodeMap &amp; <i>n</i> ) const</h3>
<p>Returns true if <i>n</i> and this named node map are equal; otherwise returns false.</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2008 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.3.5</div></td>
</tr></table></div></address></body>
</html>
